package com.web.controller;

import com.web.common.responseResult.ResponseResult;
import com.web.common.vo.TotalSaleCounts;
import com.web.service.Task1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * [一句话描述该类的功能]
 *
 * @author : [Lenovo]
 * @version : [v1.0]
 * @createTime : [2024/6/7 上午11:33]
 */
@RestController
@RequestMapping("/task1")
public class Task1Controller {
    @Autowired
    private Task1Service task1Service;
    @GetMapping("/algorithm")
    public ResponseResult<TotalSaleCounts> getTotalSalCounts(@RequestParam(name = "name") String name)
    {
        System.out.println(name);
        TotalSaleCounts totalSaleCounts =  task1Service.getTotalSaleCounts(name);
        return ResponseResult.okResult(totalSaleCounts);
    }
}
